<template>
	<view>
		<view class="staff">
			<view class="staff-em"></view>
			<view class="staff-text">活动列表</view>
		</view>

		<!-- <scroll-view scroll-y :style="'height:'+scrollH+'px;'" class="mt-2 line-h-md"> -->
		<block v-for="(item, index) in activity_list_data" :key="index">
			<view class="box">
				<view class="ml-2 mr-2 mt-2">
					<view class="contenttext"><text>活动名称：</text>{{item.title}}({{item.type_name}})</view>
					<view class="contenttext"><text>活动内容：</text>{{item.content}}</view>
					<view class="contenttext"><text>创建时间：</text>{{item.create_time}}</view>
				</view>

				<view class="link">
					<view @click="gotoindex(index)">查看活动 >></view>
					<view @click="xiangqing(item.id,item.need_pay)">商家管理 >></view>
					<view @click="modify(item.id)">修改活动 >></view>
				</view>
			</view>
		</block>
		
		<uni-load-more :status="status" class="mb-3"/>
		<!-- </scroll-view> -->

	</view>
</template>

<script>
	import uniLoadMore from '../../components/common/uni-load-more.vue'

	export default {
		components: {
			uniLoadMore,
		},
		props: {
			scrollH: null,
			status: null,
			activity_list_data: Array,
		},
		data() {
			return {
			}
		},
		onLoad() {

		},
		methods: {
			//进入主页
			gotoindex(index, activity_id) {
				uni.redirectTo({
					url: '/pages/index/index?activity_id=' + this.activity_list_data[index].id,
				})
			},

			//活动详情
			xiangqing(id, pay) {
				if (pay == null) pay = 1
				uni.navigateTo({
					url: 'details?activity_id=' + id + '&need_pay=' + pay,
				});
			},

			//修改
			modify(id) {
				uni.navigateTo({
					url: 'modify?activity_id=' + id,
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/common/main.css';
	@import  '@/common/zcm-main.css';
	
	page {
		line-height: 1.5;
	}

	.link {
		display: flex;
		padding: 15rpx 30rpx 0 30rpx;
		text-align: center;

		view {
			color: #475dfc;
			width: 33.4%;
		}
	}

	.box {
		width: 690rpx;
		background-color: #fff;
		margin: 20rpx 30rpx 20rpx 30rpx;
		border-radius: 10rpx;
		padding: 3rpx 0 5rpx 0;
		box-shadow: 3rpx 3rpx #9B9B9B;
	}

	.contenttext {
		margin-top: 10rpx;
		width: 100%;
		margin: 5rpx 0 5rpx 0;
		overflow: hidden;
		/* break-all(允许在单词内换行。) */
		word-break: break-all;
		/* 超出部分省略号 */
		text-overflow: ellipsis;
		/** 对象作为伸缩盒子模型显示 **/
		display: -webkit-box;
		/** 设置或检索伸缩盒对象的子元素的排列方式 **/
		-webkit-box-orient: vertical;
		/** 显示的行数 **/
		-webkit-line-clamp: 1;
		
		text {
			font-weight: bold;
		}
	}

	.staff {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-left: 50rpx;
		margin-top: 10rpx;

		.staff-em {
			height: 35rpx;
			width: 10rpx;
			background-color: #475dfc;
			border-radius: 50rpx;
		}

		.staff-text {
			font-weight: bold;
			margin-left: 10rpx;
		}
	}
</style>
